-
Notifications
You must be signed in to change notification settings - Fork 87
Added translation to FormElementErrors view helper #104
Added translation to FormElementErrors view helper #104
Conversation
Isnt it possible that the error messages are translated twice then? |
@MatthiasKuehneEllerhold Why do you think that they'll be translated twice? |
Added translation to FormElementErrors view helper
Thanks, @RalfEggert! |
Sorry for answering this late. I totally forgot this. This is contrary to all other translation handling: all other modules translate during the output, not during the adding of message to some queue / stack. But it is necessary in the zend-validator case to translate this early because of the placeholders that have to get replaced (e. g. So what now happens (confirmed in #188):
Depending how you set up your whole translation system this can either have no, minor or dramatic impact.
This example used this translation file: return [
"The input is not less than '%max%'" => "Die Eingabe ist nicht kleiner als '%max%'",
"Die Eingabe ist nicht kleiner als '5'" => "Die Eingabe ist kleiner als '%'",
]; I admit this example is somewhat constructed (just to highlight the problem). It all depends on how you manage your translations. I've seen implementations with same-language translations (e. g. english => english). If you're having none of the above, then you won't notice anything. |
Can you write an unit test that confirms the problem? |
Yes: #188 |
Added the possibility to translate error messages which are not translated by validators. Added test case as well.